<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 6.2.0">


  <link rel="apple-touch-icon" sizes="180x180" href="https://www.wulihub.com.cn/gc/Wez0VG/images/apple-touch-icon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="https://www.wulihub.com.cn/gc/Wez0VG/images/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="https://www.wulihub.com.cn/gc/Wez0VG/images/favicon-16x16.png">
  <link rel="mask-icon" href="https://www.wulihub.com.cn/gc/Wez0VG/images/logo.svg" color="#222">

<link rel="stylesheet" href="https://www.wulihub.com.cn/gc/Wez0VG/css/main.css">



<link rel="stylesheet" href="https://npm.elemecdn.com/@fortawesome/fontawesome-free@6.1.1/css/all.min.css" integrity="sha256-DfWjNxDkM94fVBWx1H5BMMp0Zq7luBlV8QRcSES7s+0=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://npm.elemecdn.com/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"nobige.cn","root":"/","images":"https://www.wulihub.com.cn/gc/Wez0VG/images","scheme":"Gemini","darkmode":false,"version":"8.12.2","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":false,"style":null},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"Searching...","empty":"We didn't find any results for the search: ${query}","hits_time":"${hits} results found in ${time} ms","hits":"${hits} results found"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/config.js"></script>

    <meta name="description" content="2024更新-主要核心还是依靠网关来实现流量分流，内网走哪个网关，外网走哪个网关。补充自动切换脚本，对应可视化软件  环境描述：123456789#内网 192.168.31.129#网关192.168.31.1#外网192.168.48.202#网关192.168.48.1  配置1、首先正确配置经常使用的网卡，比如外网卡，我们按照正常的方法，输入固定的 IP 地址、子网掩码、网关和 DNS">
<meta property="og:type" content="article">
<meta property="og:title" content="双网卡设置内外网同时启用">
<meta property="og:url" content="https://nobige.cn/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/index.html">
<meta property="og:site_name" content="NoBige-JackCh3n">
<meta property="og:description" content="2024更新-主要核心还是依靠网关来实现流量分流，内网走哪个网关，外网走哪个网关。补充自动切换脚本，对应可视化软件  环境描述：123456789#内网 192.168.31.129#网关192.168.31.1#外网192.168.48.202#网关192.168.48.1  配置1、首先正确配置经常使用的网卡，比如外网卡，我们按照正常的方法，输入固定的 IP 地址、子网掩码、网关和 DNS">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/fuckqq_2021-04-28_15-21-36.jpg">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/fuckqq_2021-04-28_15-25-19.jpg">
<meta property="og:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/fuckqq_2021-04-28_15-18-25.jpg">
<meta property="article:published_time" content="2021-04-28T07:19:23.000Z">
<meta property="article:modified_time" content="2024-11-07T02:59:06.310Z">
<meta property="article:author" content="JackCh3n">
<meta property="article:tag" content="win10">
<meta property="article:tag" content="网卡">
<meta property="article:tag" content="内网">
<meta property="article:tag" content="外网">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/fuckqq_2021-04-28_15-21-36.jpg">


<link rel="canonical" href="https://nobige.cn/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"en","comments":true,"permalink":"https://nobige.cn/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/","path":"post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/","title":"双网卡设置内外网同时启用"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>双网卡设置内外网同时启用 | NoBige-JackCh3n</title>
  
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-122817633-1","only_pageview":true}</script>
  <script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/analytics/google-analytics.js"></script>

  <script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/analytics/baidu-analytics.js"></script>
  <script async src="https://hm.baidu.com/hm.js?96741f92c07d010c0ddd1d02197893e2"></script>




  <noscript>
    <link rel="stylesheet" href="https://www.wulihub.com.cn/gc/Wez0VG/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">NoBige-JackCh3n</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">copy to my blog</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="home fa-fw"></i>Home</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="user fa-fw"></i>About</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="tags fa-fw"></i>Tags</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="th fa-fw"></i>Categories</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="archive fa-fw"></i>Archives</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="sitemap fa-fw"></i>Sitemap</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>Search
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="Searching..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%8E%AF%E5%A2%83%E6%8F%8F%E8%BF%B0%EF%BC%9A"><span class="nav-number">1.</span> <span class="nav-text">环境描述：</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE"><span class="nav-number">2.</span> <span class="nav-text">配置</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%87%AA%E5%8A%A8%E5%88%87%E6%8D%A2%E8%84%9A%E6%9C%AC"><span class="nav-number">3.</span> <span class="nav-text">自动切换脚本</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%8E%A9%E7%A0%81"><span class="nav-number">4.</span> <span class="nav-text">掩码</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#A%E7%B1%BBIP%E5%9C%B0%E5%9D%80-%E5%8F%AF%E7%94%A8%E5%9C%B0%E5%9D%80"><span class="nav-number">4.1.</span> <span class="nav-text">A类IP地址-可用地址</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#B%E7%B1%BBIP%E5%9C%B0%E5%9D%80-%E5%8F%AF%E7%94%A8%E5%9C%B0%E5%9D%80"><span class="nav-number">4.2.</span> <span class="nav-text">B类IP地址-可用地址</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#C%E7%B1%BBIP%E5%9C%B0%E5%9D%80-%E5%8F%AF%E7%94%A8%E5%9C%B0%E5%9D%80"><span class="nav-number">4.3.</span> <span class="nav-text">C类IP地址-可用地址</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%8F%82%E8%80%83"><span class="nav-number">5.</span> <span class="nav-text">参考</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="JackCh3n"
      src="https://www.wulihub.com.cn/gc/Wez0VG/images/avatar.png">
  <p class="site-author-name" itemprop="name">JackCh3n</p>
  <div class="site-description" itemprop="description">Record the pit filling process with words</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">146</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">42</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">279</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/jackch3n" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;jackch3n" rel="noopener" target="_blank"><i class="github fa-fw"></i>GitHub</a>
      </span>
  </div>


  <div class="links-of-blogroll site-overview-item animated">
    <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://vercel.com/?f=nobige" title="https:&#x2F;&#x2F;vercel.com?f&#x3D;nobige" rel="noopener" target="_blank">vercel</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.jsdelivr.com/?f=nobige" title="https:&#x2F;&#x2F;www.jsdelivr.com?f&#x3D;nobige" rel="noopener" target="_blank">jsdelivr</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://www.upyun.com/?f=nobige" title="https:&#x2F;&#x2F;www.upyun.com?f&#x3D;nobige" rel="noopener" target="_blank">upyun</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://coding.net/?f=nobige" title="https:&#x2F;&#x2F;coding.net?f&#x3D;nobige" rel="noopener" target="_blank">coding</a>
        </li>
        <li class="links-of-blogroll-item">
          <a href="https://unsplash.com/?f=nobige" title="https:&#x2F;&#x2F;unsplash.com?f&#x3D;nobige" rel="noopener" target="_blank">unsplash</a>
        </li>
    </ul>
  </div>

        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="Back to top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="en">
    <link itemprop="mainEntityOfPage" href="https://nobige.cn/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://www.wulihub.com.cn/gc/Wez0VG/images/avatar.png">
      <meta itemprop="name" content="JackCh3n">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="NoBige-JackCh3n">
      <meta itemprop="description" content="Record the pit filling process with words">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="双网卡设置内外网同时启用 | NoBige-JackCh3n">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          双网卡设置内外网同时启用
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">Posted on</span>

      <time title="Created: 2021-04-28 15:19:23" itemprop="dateCreated datePublished" datetime="2021-04-28T15:19:23+08:00">2021-04-28</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">Edited on</span>
      <time title="Modified: 2024-11-07 10:59:06" itemprop="dateModified" datetime="2024-11-07T10:59:06+08:00">2024-11-07</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">In</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E6%8A%80%E5%B7%A7/" itemprop="url" rel="index"><span itemprop="name">技巧</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="Views" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">Views: </span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <blockquote>
<p>2024更新-主要核心还是依靠网关来实现流量分流，内网走哪个网关，外网走哪个网关。补充自动切换脚本，对应可视化软件</p>
</blockquote>
<h2 id="环境描述："><a href="#环境描述：" class="headerlink" title="环境描述："></a>环境描述：</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#内网 </span></span><br><span class="line">192.168.31.129</span><br><span class="line"><span class="comment">#网关</span></span><br><span class="line">192.168.31.1</span><br><span class="line"></span><br><span class="line"><span class="comment">#外网</span></span><br><span class="line">192.168.48.202</span><br><span class="line"><span class="comment">#网关</span></span><br><span class="line">192.168.48.1</span><br></pre></td></tr></table></figure>

<h2 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h2><p>1、首先正确配置经常使用的网卡，比如外网卡，我们按照正常的方法，输入固定的 IP 地址、子网掩码、网关和 DNS 等信息，比如外网地址为 192.168.48.202，网关为 192.168.48.1</p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/fuckqq_2021-04-28_15-21-36.jpg" alt="外网设置"></p>
<p>2、接着，我们在另一张网卡设置内网，输入分配的 IP 地址和子网掩码，比如为  192.168.31.129，网关192.168.31.1确定即可。</p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/fuckqq_2021-04-28_15-25-19.jpg" alt="内网设置"></p>
<p>3、然后，打开 DOS 窗口（开始菜单找到【运行】功能或 Win+R，输入 cmd)，输入 dos 命令 <code>route print</code>，查看系统路由信息。</p>
<p><img src="https://blog-static.nobige.cn/gh/JackCh3n/n0bige/post/20210428-shuang_wang_ka_she_zhi_nei_wai_wang_tong_shi_qi_yong/fuckqq_2021-04-28_15-18-25.jpg" alt="route print"></p>
<p>4、删除关于内网网卡自动设置的路由，如：</p>
<figure class="highlight basic"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">route <span class="keyword">delete</span> <span class="number">0.0</span>.<span class="number">0.0</span></span><br><span class="line">route <span class="keyword">delete</span> <span class="number">11.23</span>.<span class="number">2.1</span></span><br></pre></td></tr></table></figure>

<p>5、删除完后开始添加内外网卡的路由</p>
<figure class="highlight basic"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"># 外网网卡路由，METRIC为跃点数，越低则越优先</span><br><span class="line">route -p add <span class="number">0.0</span>.<span class="number">0.0</span> mask <span class="number">0.0</span>.<span class="number">0.0</span> <span class="number">192.168</span>.<span class="number">48.1</span> METRIC <span class="number">20</span></span><br><span class="line"># 内网网卡路由，METRIC为跃点数，越低则越优先</span><br><span class="line">route -p add <span class="number">10.0</span>.<span class="number">0.1</span> mask <span class="number">255.0</span>.<span class="number">0.0</span> <span class="number">192.168</span>.<span class="number">31.1</span> METRIC <span class="number">1</span></span><br><span class="line">route -p add <span class="number">172.16</span>.<span class="number">0.1</span> mask <span class="number">255.240</span>.<span class="number">0.0</span> <span class="number">192.168</span>.<span class="number">31.1</span> METRIC <span class="number">2</span></span><br><span class="line">route -p add <span class="number">192.168</span>.<span class="number">0.1</span> mask <span class="number">255.255</span>.<span class="number">0.0</span> <span class="number">192.168</span>.<span class="number">31.1</span> METRIC <span class="number">3</span></span><br></pre></td></tr></table></figure>

<p>5、完成后，内外网就都可以访问了。若还是不行，则可以尝试<code>route print命</code>令来查看当前路由情况来进行适当调整。</p>
<h2 id="自动切换脚本"><a href="#自动切换脚本" class="headerlink" title="自动切换脚本"></a>自动切换脚本</h2><blockquote>
<p>bat脚本</p>
</blockquote>
<figure class="highlight bat"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off</span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">REM 外网网络-网关</span></span><br><span class="line"><span class="built_in">set</span> gateway1=<span class="number">192</span>.<span class="number">168</span>.<span class="number">0</span>.<span class="number">1</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">REM 内网网络-网关</span></span><br><span class="line"><span class="built_in">set</span> gateway2=<span class="number">10</span>.<span class="number">10</span>.<span class="number">10</span>.<span class="number">1</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> /f &quot;tokens=<span class="number">3</span>&quot; <span class="variable">%%a</span> <span class="keyword">in</span> (&#x27;route <span class="built_in">print</span> <span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span> ^| <span class="built_in">find</span> &quot;<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>&quot;&#x27;) <span class="keyword">do</span> (</span><br><span class="line">    <span class="built_in">set</span> curr_gateway=<span class="variable">%%a</span></span><br><span class="line">)</span><br><span class="line"><span class="keyword">if</span> &quot;<span class="variable">%curr_gateway%</span>&quot; == &quot;<span class="variable">%gateway1%</span>&quot; (</span><br><span class="line">    <span class="built_in">echo</span> <span class="variable">%gateway1%</span> route change to <span class="variable">%gateway2%</span></span><br><span class="line">    route delete <span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span></span><br><span class="line">    timeout /t <span class="number">3</span></span><br><span class="line">    route -p add <span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span> mask <span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span> <span class="variable">%gateway2%</span> metric <span class="number">8</span></span><br><span class="line">) <span class="keyword">else</span> (</span><br><span class="line">    <span class="built_in">echo</span> <span class="variable">%gateway2%</span> route change to <span class="variable">%gateway1%</span></span><br><span class="line">    route delete <span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span></span><br><span class="line">    timeout /t <span class="number">3</span></span><br><span class="line">    route -p add <span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span> mask <span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span> <span class="variable">%gateway1%</span> metric <span class="number">8</span></span><br><span class="line">)</span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">REM 清空DNS缓存</span></span><br><span class="line"><span class="built_in">ipconfig</span> /flushdns</span><br><span class="line"><span class="built_in">echo</span> route info</span><br><span class="line">route <span class="built_in">print</span> <span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span> | <span class="built_in">findstr</span> &quot;<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>.<span class="number">0</span>&quot;</span><br></pre></td></tr></table></figure>

<h2 id="掩码"><a href="#掩码" class="headerlink" title="掩码"></a>掩码</h2><h3 id="A类IP地址-可用地址"><a href="#A类IP地址-可用地址" class="headerlink" title="A类IP地址-可用地址"></a>A类IP地址-可用地址</h3><blockquote>
<p>范围</p>
<p>10.0.0.0～10.255.255.255 </p>
</blockquote>
<table>
<thead>
<tr>
<th>A类-可用地址:</th>
<th>16777214</th>
</tr>
</thead>
<tbody><tr>
<td>掩码:</td>
<td>255.0.0.0</td>
</tr>
<tr>
<td>网络:</td>
<td>10.0.0.0</td>
</tr>
<tr>
<td>第一个可用:</td>
<td>10.0.0.1</td>
</tr>
<tr>
<td>最后可用：</td>
<td>10.255.255.254</td>
</tr>
<tr>
<td>广播:</td>
<td>10.255.255.255</td>
</tr>
</tbody></table>
<h3 id="B类IP地址-可用地址"><a href="#B类IP地址-可用地址" class="headerlink" title="B类IP地址-可用地址"></a>B类IP地址-可用地址</h3><blockquote>
<p>范围</p>
<p>172.16.0.0～172.31.255.255 </p>
</blockquote>
<table>
<thead>
<tr>
<th>A类-可用地址:</th>
<th>1048574</th>
</tr>
</thead>
<tbody><tr>
<td>掩码:</td>
<td>255.240.0.0</td>
</tr>
<tr>
<td>网络:</td>
<td>172.16.0.0</td>
</tr>
<tr>
<td>第一个可用:</td>
<td>172.16.0.1</td>
</tr>
<tr>
<td>最后可用：</td>
<td>172.31.255.254</td>
</tr>
<tr>
<td>广播:</td>
<td>172.31.255.255</td>
</tr>
</tbody></table>
<h3 id="C类IP地址-可用地址"><a href="#C类IP地址-可用地址" class="headerlink" title="C类IP地址-可用地址"></a>C类IP地址-可用地址</h3><blockquote>
<p>范围</p>
<p>192.168.0.0～192.168.255.255</p>
</blockquote>
<table>
<thead>
<tr>
<th>C类-可用地址:</th>
<th>65534</th>
</tr>
</thead>
<tbody><tr>
<td>掩码:</td>
<td>255.255.0.0</td>
</tr>
<tr>
<td>网络:</td>
<td>192.168.0.0</td>
</tr>
<tr>
<td>第一个可用:</td>
<td>192.168.0.1</td>
</tr>
<tr>
<td>最后可用：</td>
<td>192.168.255.254</td>
</tr>
<tr>
<td>广播:</td>
<td>192.168.255.254</td>
</tr>
</tbody></table>
<h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"># ————————————————</span><br><span class="line"># 日期:2021-04-28</span><br><span class="line"># 参考链接：https://zhidao.baidu.com/question/443325926.html</span><br></pre></td></tr></table></figure>


    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/win10/" rel="tag"># win10</a>
              <a href="/tags/%E7%BD%91%E5%8D%A1/" rel="tag"># 网卡</a>
              <a href="/tags/%E5%86%85%E7%BD%91/" rel="tag"># 内网</a>
              <a href="/tags/%E5%A4%96%E7%BD%91/" rel="tag"># 外网</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/post/20201211-chang_yong_duan_kou_zheng_li/" rel="prev" title="常用端口整理">
                  <i class="fa fa-chevron-left"></i> 常用端口整理
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/post/20210527-frp_nei_wang_chuan_tou_an_zhuang_yu_pei_zhi/" rel="next" title="frp内网穿透安装与配置">
                  frp内网穿透安装与配置 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    
  <div class="comments" id="disqus_thread">
    <noscript>Please enable JavaScript to view the comments powered by Disqus.</noscript>
  </div>
  
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">JackCh3n</span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="Total Visitors">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="Total Views">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" rel="noopener" target="_blank">NexT.Gemini</a>
  </div>
    <br/>Powerful CDN service provided by 
  <a target="_blank" rel="noopener" href="https://www.upyun.com/?utm_source=lianmeng&utm_medium=referral" style="border:none"><img src="https://www.wulihub.com.cn/gc/Wez0VG/images/upyun_logo.png" height="66" style="display: list-item;" alt="upyun"></a> 
  <a target="_blank" rel="noopener" href="https://www.jsdelivr.com" style="border:none"><img src="https://www.wulihub.com.cn/gc/Wez0VG/images/jsdelivr_logo.svg" height="50" style="display: list-item;" alt="JsDelivr"></a>
  <p>
  <br/><a target="_blank" rel="noopener" href="https://pages.github.com/?f=nobige">Github Pages</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://vercel.com/?f=nobige">Vercel</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://www.netlify.com/?f=nobige">Netlify</a>&nbsp;&nbsp;<a target="_blank" rel="noopener" href="https://coding.net/?f=nobige">coding</a>&nbsp;&nbsp;provides static publishing
  </p>

    </div>
  </footer>

  
  <script src="https://npm.elemecdn.com/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/comments.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/utils.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/motion.js"></script><script src="https://www.wulihub.com.cn/gc/Wez0VG/js/next-boot.js"></script>

  
<script src="https://npm.elemecdn.com/hexo-generator-searchdb@1.4.0/dist/search.js" integrity="sha256-vXZMYLEqsROAXkEw93GGIvaB2ab+QW6w3+1ahD9nXXA=" crossorigin="anonymous"></script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/search/local-search.js"></script>





  
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




<link rel="stylesheet" href="https://npm.elemecdn.com/disqusjs@1.3.0/dist/disqusjs.css" integrity="sha256-GxdCIOyfxQ1OBfS99qAIJDoGK1ADuBsxhMTqXG82fAY=" crossorigin="anonymous">

<script class="next-config" data-name="disqusjs" type="application/json">{"enable":true,"api":"https://duosuo.nobige.cn/","apikey":"Kmo9kPwsir7ppp8tGpeGROCmUtW8tdZBOdBVowPC67xVfTS5uV1wr6s4kckvP95m","shortname":"nobige","js":{"url":"https://npm.elemecdn.com/disqusjs@1.3.0/dist/disqus.js","integrity":"sha256-LVaMHPQ2zLqOc5rXSAfr4d1PIkEGNLyyUTDNPZmTtUw="}}</script>
<script src="https://www.wulihub.com.cn/gc/Wez0VG/js/third-party/comments/disqusjs.js"></script>

</body>
</html>
